package ndk.caro.activities;

import ndk.caro.activities.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.ImageView;
import ndk.caro.gameplays.myPiece;

public class myWinnerActivity extends Activity{
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {		
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.winner_layout);
		
		Intent intent = getIntent();
		ImageView imageview = (ImageView)findViewById(R.id.img_winner);
		if(Integer.parseInt(intent.getAction()) == myPiece.iXPLAYER) 
			imageview.setBackgroundResource(R.drawable.x);
		else if(Integer.parseInt(intent.getAction()) == myPiece.iOPLAYER)
			imageview.setBackgroundResource(R.drawable.o);
		
		imageview.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				finish();
			}
		});
	}

	public void onClick(View v) {
		finish();
	}
}
